<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ page language="java" contentType="text/html; UTF-8"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%
String filePath="";
if(request.getAttribute("filePath")!=null){
	filePath=request.getAttribute("filePath").toString();
	System.out.println(filePath);
}
%>
<script>
window.onload = function test()
{
	alert("test");
	}
function onloadFunction()
{
	
	alert(<%=filePath%>);
if('<%=filePath%>'!=null && '<%=filePath%>'!='')
	{
	alert(<%=filePath%>);
	
	}
}
</script>
</head>
<body onload="test()">
<script>var path='<%=filePath%>';
if(path!=null && path!=''){window.opener.document.getElementById('txtPhotoPath').value=path;window.opener.document.getElementById('txtPhotoPath_div').innerHTML="<img src="+path+" width='300px' height='300px'>";}</script>
		<p>Commons File Upload Example</p>
		<form action="/Yunysha/CommonsFileUploadServlet" enctype="multipart/form-data" method="POST">
			<input type="file" name="file1"><br>
			<input type="Submit" value="Upload File"><br>
		</form>
	
	
</body>
</html>